home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 1.0 for Developers / QuickTime 1.0 for Developers.iso / Programming Stuff / Interfaces / Oldstyle C Interfaces / MovieController.h < prev    next >
C/C++ Source or Header  |  1991-09-06  |  8KB  |  214 lines

  1. /*
  2.     File:        MovieController.h
  3.     Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  4. */
  5.  
  6. #ifndef _MovieController_
  7. #define _MovieController_
  8.  
  9. #include <QuickDraw.h>
  10. #include <Windows.h>
  11. #include <QDOffscreen.h>
  12.  
  13. #include "Components.h"
  14. #include "Movies.h"
  15.  
  16. typedef ComponentInstance MovieController;
  17.  
  18. typedef enum {                /* !!! should remove obsolete things !!! */
  19.     mcIdle = 1,
  20.     mcDraw,
  21.     mcActivate,
  22.     mcDeactivate,
  23.     mcMouseDown,
  24.     mcKey,
  25.     mcReserved6,
  26.     mcPlay,                        /* param is fixed-rate */
  27.     mcReserved7,
  28.     mcGotoStart,
  29.     mcGotoEnd,
  30.     mcGotoTime,
  31.     mcMuteToggle,
  32.     mcSetVolume,
  33.     mcGetVolume,
  34.     mcReserved2,
  35.     mcReserved3,
  36.     mcStep,                        /* param is number of steps */
  37.     mcReserved8,
  38.     mcReserved9,
  39.     mcSetLooping,
  40.     mcGetLooping,
  41.     mcSetLoopIsPalindrome,
  42.     mcGetLoopIsPalindrome,
  43.     mcSetGrowBoxBounds,
  44.     mcControllerSizeChanged,
  45.     mcReserved4,
  46.     mcReserved5,
  47.     mcSetSelectionBegin,
  48.     mcSetSelectionDuration,        /* action only taken on set-duration */
  49.     mcSetPosterTime,
  50.     mcSetKeysEnabled,
  51.     mcGetKeysEnabled,
  52.     mcSetPlaySelection,
  53.     mcGetPlaySelection,
  54.     mcSetUseBadge,                /* param is boolean */
  55.     mcGetUseBadge,                /* param is ptr to boolean */
  56.     mcSetFlags,                    /* param = long of bits */
  57.     mcGetFlags,                    /* param = ptr to long of bits */
  58.     mcSetPlayEveryFrame,
  59.     mcGetPlayEveryFrame
  60. } mcAction;
  61.  
  62.  
  63. typedef enum
  64.     {
  65.     mcFlagSuppressMovieFrame = 1<<0,
  66.     mcFlagSuppressStepButtons = 1<<1,
  67.     mcFlagSuppressSpeakerButton = 1<<2
  68.     } mcFlags;
  69.  
  70.  
  71. #if THINK_C==1
  72.     typedef Boolean (*MCActionFilter)(MovieController mc, short *action, void *params);
  73. #else
  74.     typedef pascal Boolean (*MCActionFilter)(MovieController mc, short *action, void *params);
  75. #endif
  76.  
  77. /* target management */
  78. pascal ComponentResult MCSetMovie(MovieController mc, Movie m, WindowPtr movieWindow,
  79.                         Point where) =                 {0x2f3c,12,2,0x7000,0xa82a};
  80. /*
  81.    if movieWindow is 0, the current port is used
  82.    where is the topLeft point of the movie rectangle -- to have a default size
  83.        other than the movie rectangle, use SetMovieBounds before calling MCSetMovie
  84.    do we need to also pass a GDevice??
  85.     
  86.     */
  87.  
  88. pascal ComponentResult MCRemoveMovie(MovieController mc, Movie m) =                 {0x2f3c,4,3,0x7000,0xa82a};
  89. pascal long MCCountMovies(MovieController mc) =                 {0x2f3c,0,4,0x7000,0xa82a};
  90. pascal Movie MCGetIndMovie(MovieController mc, short index) =                 {0x2f3c,2,5,0x7000,0xa82a};
  91. pascal ComponentResult MCRemoveAllMovies(MovieController mc) =                 {0x2f3c,0,6,0x7000,0xa82a};
  92.  
  93. /* event handling etc. */
  94. pascal ComponentResult MCIsPlayerEvent(MovieController mc, const EventRecord *e) =                 {0x2f3c,4,7,0x7000,0xa82a};
  95.  
  96. pascal void MCSetActionFilter(MovieController mc, MCActionFilter blob) =                 {0x2f3c,4,8,0x7000,0xa82a};
  97.  
  98. /*
  99.     proc is of the form:
  100.         Boolean userPlayerFilter(MovieController mc, short *action, void *params) =
  101.     proc returns TRUE if it handles the action, FALSE if not
  102.     action is passed as a VAR so that it could be changed by filter (ick)
  103.     this is consistent with the current dialog manager stuff
  104.     params is any potential parameters that go with the action <triple ick> 
  105.         such as set playback rate to xxx.
  106. */
  107. pascal ComponentResult MCDoAction(MovieController mc, short action, void *params) =                 {0x2f3c,6,9,0x7000,0xa82a};
  108.  
  109. /* state type things */
  110. pascal ComponentResult MCSetControllerAttached(MovieController mc, Boolean attach) =                 {0x2f3c,2,10,0x7000,0xa82a};
  111. pascal ComponentResult MCIsControllerAttached(MovieController mc) =                 {0x2f3c,0,11,0x7000,0xa82a};
  112. pascal ComponentResult MCSetControllerPort(MovieController mc, CGrafPtr gp) =                 {0x2f3c,4,12,0x7000,0xa82a};
  113. pascal CGrafPtr MCGetControllerPort(MovieController mc) =                 {0x2f3c,0,13,0x7000,0xa82a};
  114.  
  115. pascal ComponentResult MCGetVisible(MovieController mc) =                 {0x2f3c,0,15,0x7000,0xa82a};
  116. pascal ComponentResult MCSetVisible(MovieController mc, Boolean visible) =                 {0x2f3c,2,14,0x7000,0xa82a};
  117.  
  118. pascal ComponentResult MCGetControllerBoundsRect(MovieController mc, Rect *bounds) =                 {0x2f3c,4,16,0x7000,0xa82a};
  119. pascal ComponentResult MCSetControllerBoundsRect(MovieController mc, const Rect *bounds) =                 {0x2f3c,4,17,0x7000,0xa82a};
  120. pascal RgnHandle MCGetControllerBoundsRgn(MovieController mc) =                 {0x2f3c,0,18,0x7000,0xa82a};
  121. pascal RgnHandle MCGetWindowRgn(MovieController mc, WindowPtr w) =                 {0x2f3c,4,19,0x7000,0xa82a};
  122.  
  123. /* other stuff */
  124. pascal ComponentResult MCMovieChanged(MovieController mc, Movie m) =                 {0x2f3c,4,20,0x7000,0xa82a};
  125. /*
  126.     called when the app has changed thing about the movie (like bounding rect) or rate. So that we
  127.         can update our graphical (and internal) state accordingly.
  128. */
  129. pascal ComponentResult MCSetDuration(MovieController mc, TimeValue duration) =                 {0x2f3c,4,21,0x7000,0xa82a};
  130. /*
  131.     duration to use for time slider -- will be reset next time MCMovieChanged is called
  132.         or MCSetMovie is called
  133. */
  134. pascal TimeValue MCGetCurrentTime(MovieController mc, TimeScale *scale) =                 {0x2f3c,4,22,0x7000,0xa82a};
  135. /*
  136.     returns the time value and the time scale it is on. if there are no movies, the
  137.         time scale is passed back as 0. scale is an optional parameter
  138.  
  139. */
  140. pascal ComponentResult MCNewAttachedController(MovieController mc, Movie m, 
  141.                 WindowPtr w, Point where) =                 {0x2f3c,12,23,0x7000,0xa82a};
  142. /*
  143.     makes m the only movie attached to the controller. makes the controller visible.
  144.     the window and where parameters are passed a long to MCSetMovie and behave as
  145.     described there
  146. */
  147.  
  148. pascal ComponentResult MCDraw(MovieController mc, WindowPtr w) =                 {0x2f3c,4,24,0x7000,0xa82a};
  149. pascal ComponentResult MCActivate(MovieController mc, WindowPtr w, Boolean activate) =                 {0x2f3c,6,25,0x7000,0xa82a};
  150. pascal ComponentResult MCIdle(MovieController mc) =                 {0x2f3c,0,26,0x7000,0xa82a};
  151. pascal ComponentResult MCKey(MovieController mc, char key, long modifiers) =                 {0x2f3c,6,27,0x7000,0xa82a};
  152. pascal ComponentResult MCClick(MovieController mc, WindowPtr w, Point where, long when, long modifiers) =                 {0x2f3c,16,28,0x7000,0xa82a};
  153.  
  154. /*
  155.     calls for editing
  156. */
  157. pascal ComponentResult MCEnableEditing(MovieController mc, Boolean enabled) =         {0x2f3c,2,29,0x7000,0xa82a};
  158. pascal long MCIsEditingEnabled(MovieController mc) =         {0x2f3c,0,30,0x7000,0xa82a};
  159. pascal Movie MCCopy(MovieController mc) =         {0x2f3c,0,31,0x7000,0xa82a};
  160. pascal Movie MCCut(MovieController mc) =         {0x2f3c,0,32,0x7000,0xa82a};
  161. pascal ComponentResult MCPaste(MovieController mc, Movie srcMovie) =         {0x2f3c,4,33,0x7000,0xa82a};
  162. pascal ComponentResult MCClear(MovieController mc) =         {0x2f3c,0,34,0x7000,0xa82a};
  163. pascal ComponentResult MCUndo(MovieController mc) =         {0x2f3c,0,35,0x7000,0xa82a};
  164.  
  165. /*
  166.  *    somewhat special stuff
  167.  */
  168. pascal ComponentResult MCPositionController(MovieController mc, Rect *movieRect,
  169.         Rect *controllerRect, long someFlags) =         {0x2f3c,12,36,0x7000,0xa82a};
  170.  
  171. /*
  172.     menu related stuff
  173. */
  174. enum {
  175.     mcInfoUndoAvailable = 1<<0,
  176.     mcInfoCutAvailable = 1<<1,
  177.     mcInfoCopyAvailable = 1<<2,
  178.     mcInfoPasteAvailable = 1<<3,
  179.     mcInfoClearAvailable = 1<<4,
  180.     mcInfoHasSound = 1<<5,
  181.     mcInfoIsPlaying = 1<<6,
  182.     mcInfoIsLooping = 1<<7,
  183.     mcInfoIsInPalindrome = 1<<8,
  184.     mcInfoEditingEnabled = 1<<9
  185. };
  186.  
  187. pascal ComponentResult MCGetControllerInfo(MovieController mc, long *someFlags) =                 {0x2f3c,4,37,0x7000,0xa82a};
  188.  
  189.  
  190.  
  191. pascal ComponentResult MCNewControllerFromFile(MovieController mc, short resRefNum, short resId,
  192.         WindowPtr movieWindow,Point where) =         {0x2f3c,12,38,0x7000,0xa82a};
  193.  
  194. pascal ComponentResult MCSetBadgePict(MovieController mc,PicHandle badgePict) =         {0x2f3c,4,39,0x7000,0xa82a};
  195.  
  196. pascal ComponentResult MCSetClip(MovieController mc, RgnHandle theClip, RgnHandle movieClip) =         {0x2f3c,8,40,0x7000,0xa82a};
  197. pascal ComponentResult MCGetClip(MovieController mc, RgnHandle *theClip, RgnHandle *movieClip) =         {0x2f3c,8,41,0x7000,0xa82a};
  198.  
  199. pascal ComponentResult MCDrawBadge(MovieController mc, RgnHandle movieRgn, RgnHandle *badgeRgn) =         {0x2f3c,8,42,0x7000,0xa82a};
  200.  
  201. /**** error codes ******/
  202. enum {
  203.     cannotMoveAttachedController = -9999,
  204.     controllerHasFixedHeight = -9998,
  205.     cannotSetWidthOfAttachedController = -9997,
  206.     controllerBoundsNotExact = -9996,
  207.     editingNotAllowed = -9995,
  208.     badControllerHeight = -9994
  209. };
  210.  
  211.  
  212.  
  213. #endif _MovieController_
  214.